-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wpimath] Add affine transformation constructors and getters to geometry API #7430
base: main
Are you sure you want to change the base?
Conversation
60a319b
to
4d2c89e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll note that Pose2d.toMatrix()
is not a direct substitute for the StateSpaceUtil
functions since those functions return vectors while toMatrix()
returns an affine transformation matrix. I'm still fine with deprecating, but maybe we should change the suggestion since going from the matrix to the vector is at least as complicated as just making the vector yourself?
6875010
to
7f2049b
Compare
public static Matrix<N3, N1> poseTo3dVector(Pose2d pose) {
return VecBuilder.fill(
pose.getTranslation().getX(),
pose.getTranslation().getY(),
pose.getRotation().getRadians()
);
} for a class that already has a lot of moving parts: public void addVisionMeasurement(Pose2d visionRobotPoseMeters, double timestampSeconds) {
m_latencyCompensator.applyPastGlobalMeasurement(
Nat.N3(),
m_observer, m_nominalDt,
StateSpaceUtil.poseTo3dVector(visionRobotPoseMeters),
m_visionCorrect,
timestampSeconds
);
} I don't see a use for these functions outside this very specific instance. They aren't even useful for affine transformations directly, as you pointed out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, for what it's worth.
3288b3c
to
7e1dc0c
Compare
Unfortunately, we can't merge it until we drop GCC 10, cuz we hit a Raspberry Pi compiler ICE in unrelated code. |
Fixes #7429.